home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / source / mount.lha / mount / README.TXT < prev    next >
Encoding:
Text File  |  1994-07-28  |  2.0 KB  |  47 lines

  1. This code is provided as-is, for instructional purposes only.  You may redistribute
  2. it or use it as you like, but by doing so you hold the authors and distributors
  3. harmless for any damages it may cause.  This code is Copyright (c) 1994 Doug Walker,
  4. All Rights Reserved.
  5.  
  6. Here are two functions that will mount and dismount a volume node in the DOS list,
  7. assigning all incoming messages to a specific port OTHER THAN the one in the Task
  8. structure.
  9.  
  10. If you are writing a handler, this gives the following advantages:
  11.  
  12.    1. No need for mountlist entries or using Mount to mount your file system.
  13.    
  14.    2. You can run as a normal process instead of a Task, which means you can
  15.       use your normal debugger, printf(), stdin, stdout, etc.
  16.  
  17. The following two functions are provided:
  18.  
  19.    struct DeviceList *Mount(char *name, struct MsgPort *port);
  20.  
  21.       Mounts a volume with the given name and assigns all incoming DOS packets to 
  22.       the specified MsgPort.
  23.  
  24.    int DisMount(struct DeviceList *volume);
  25.  
  26.       Dismounts a volume, given a pointer to its volume node.  Must be a volume that
  27.       was mounted with Mount().
  28.  
  29. If you have SAS/C, simply enter this directory and type "scsetup" followed by "smake" 
  30. to compile and link the test program.  This distribution consists of four files:
  31.  
  32.    test.c     - Test program.  Type "test foo" to mount a volume called "foo".
  33.    mount.h    - Prototypes for Mount() and DisMount().
  34.    mount.c    - Version of Mount() and DisMount() that works on any version of AmigaDOS
  35.    mountv37.c - Version of Mount() and DisMount() for version 37 and up (AmigaDOS 2.0 and above)
  36.  
  37. When you use smake, it links a program called "test" and one called "testv37".  The latter
  38. is linked with mountv37.c and will only work on AmigaDOS 2.0 and above.
  39.  
  40. IMPORTANT NOTE: The test program isn't designed perfectly; it's a proof-of-principle, but it
  41. does have some multitasking "holes" in it.  Writing a good handler is left as an exercise for
  42. the reader 8^)
  43.  
  44. Happy programming!
  45.  
  46.    --Doug Walker
  47.